package com.zhilianbao.leyaogo.http.api;

import android.content.Context;

import com.zhilianbao.leyaogo.constants.HttpConfig;
import com.zhilianbao.leyaogo.http.client.LeYaoGoClient;
import com.zhilianbao.leyaogo.utils.Utils;
import com.zhilianbao.okhttputils.callback.Callback;
import com.zhilianbao.okhttputils.model.JsonParams;

/**
 * ClassName: SearchApi <br>
 * Description: <br>
 * Author: Cyarie <br>
 * Created: 2016/12/6 17:24 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class SearchApi {

    /**
     * 搜索商品
     *
     * @param context
     * @param goodsName
     * @param pageNo
     * @param pageSize
     * @param callback
     */
    public static void search(Context context, String goodsName, int pageNo, int pageSize, Callback callback) {
        JsonParams jsonParams = new JsonParams();
        jsonParams.put("supplierId", Utils.getSupplierId());
        jsonParams.put("goodsName", goodsName);
        jsonParams.put("pageNo", pageNo);
        jsonParams.put("pageSize", pageSize);
        LeYaoGoClient.post(context, HttpConfig.BASE_URL + HttpConfig.METHOD_GET_GOODS_LIST, jsonParams, callback);
    }
}
